package entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * The persistent class for the nomikaimember database table.
 * 
 */
@Entity
@Table(name="nomikaimember")
public class Nomikaimember implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	private long nomikaimemberid;
	
	// @Column(nullable = false, columnDefinition = "bool default false")
	private Character attend;

	// @Column(nullable = false, columnDefinition = "bool default false")
	private Character steward;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="userid", nullable=false)
	private User userid;

	//bi-directional many-to-one association to Nomikai
	@ManyToOne
	@JoinColumn(name="nomikaiid", nullable=false)
	private Nomikai nomikaiid;

	public Nomikaimember() {
	}

	public long getNomikaimemberid() {
		return this.nomikaimemberid;
	}

	public void setNomikaimemberid(long nomikaimemberid) {
		this.nomikaimemberid = nomikaimemberid;
	}

	public Boolean getAttend() {
		if (this.attend== null) {
			return null;
		}
		return this.attend == 'Y' ? Boolean.TRUE : Boolean.FALSE;
	}

	public void setAttend(Boolean attend) {
		if (this.attend == null) {
			this.attend = null;
		}
		this.attend = attend == Boolean.TRUE ? 'Y' : 'N';
	}

	public Boolean getSteward() {
		if (this.steward == null) {
			return null;
		}
		return this.steward == 'Y' ? Boolean.TRUE : Boolean.FALSE;
	}

	public void setSteward(Boolean steward) {
		if (this.steward == null) {
			this.steward = null;
		}
		this.steward = steward == Boolean.TRUE ? 'Y' : 'N';
	}

	public User getUserid() {
		return this.userid;
	}

	public void setUserid(User userid) {
		this.userid = userid;
	}

	public Nomikai getNomikaiid() {
		return this.nomikaiid;
	}

	public void setNomikaiid(Nomikai nomikaiid) {
		this.nomikaiid = nomikaiid;
	}

}